EntryHandler

wrapper interface for 4 basic handling interfaces

  • serialize value

  • deserialize inputs

  • validate updates

  • correct errors

Interface method: copyValue, handles providing deep copies of passed inputs (as deep as possible)

Author

fzzyhmstrs

Since

0.2.0, copyValue added 0.6.0

Parameters

T

the non-null type of the Entry stored value

Inheritors

Functions

Link copied to clipboard
open fun copyValue(input: T): T

Copies the provided input as deeply as possible.

Link copied to clipboard

Corrects an attempted input, as possible. When correction isn't possible or deterministic, simply validate the entry the same way you would for EntryValidator

Link copied to clipboard
open fun deserializedChanged(old: Any?, new: Any?): Boolean

Specialized equals method for determining if a newly deserialized value is effectively equal to its old counterpart.

Link copied to clipboard
abstract fun deserializeEntry(toml: TomlElement, errorBuilder: MutableList<String>, fieldName: String, flags: Byte): ValidationResult<T>

Deserializes the provided TomlElement. This deserialization should store the result within this deserializer (deserialize "in-place") as well as returning the result. The return has to have a fallback value.

Link copied to clipboard
abstract fun serializeEntry(input: T?, errorBuilder: MutableList<String>, flags: Byte): TomlElement

Serializes either the provided input or stored value to a TomlElement

Link copied to clipboard

Validates an input per the provided validation type.